import pandas as pd
import numpy as np

file_path = "./csv/IMDB-Movie-Data.csv"
df = pd.read_csv(file_path)

# print(df.info())

print(df.head(1))

#获取平均评分
print("平均评分=",df["Rating"].mean())

#导演的人数 两种方法
print(len(set(df["Director"].tolist())))
print(len(df["Director"].unique()))

#获取演员的人数
temp_actors_list = df["Actors"].str.split(", ").tolist()
print(temp_actors_list)
actors_list = [i for j in temp_actors_list for i in j]
actors_num = len(set(actors_list))
print("演员的人数=", actors_num)